//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.activiti.engine.impl.bpmn.behavior;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class TaskActivityBehavior extends AbstractBpmnActivityBehavior {
  private static final long serialVersionUID = 1L;

  public TaskActivityBehavior() {
  }

  protected String getActiveValue(String originalValue, String propertyName, ObjectNode taskElementProperties) {
    String activeValue = originalValue;
    if (taskElementProperties != null) {
      JsonNode overrideValueNode = taskElementProperties.get(propertyName);
      if (overrideValueNode != null) {
        if (overrideValueNode.isNull()) {
          activeValue = null;
        } else {
          activeValue = overrideValueNode.asText();
        }
      }
    }

    return activeValue;
  }

  protected List<String> getActiveValueList(List<String> originalValues, String propertyName, ObjectNode taskElementProperties) {
    List<String> activeValues = originalValues;
    if (taskElementProperties != null) {
      JsonNode overrideValuesNode = taskElementProperties.get(propertyName);
      if (overrideValuesNode != null) {
        if (!overrideValuesNode.isNull() && overrideValuesNode.isArray() && overrideValuesNode.size() != 0) {
          activeValues = new ArrayList();
          Iterator var6 = overrideValuesNode.iterator();

          while(var6.hasNext()) {
            JsonNode valueNode = (JsonNode)var6.next();
            ((List)activeValues).add(valueNode.asText());
          }
        } else {
          activeValues = null;
        }
      }
    }

    return (List)activeValues;
  }
}
